﻿using Architecture.Repository.Interface;
using Architeture.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Architecture.Domain.Service
{
    public class SlaughterService : ISlaughterService
    {
        protected readonly IslaughterRepository repository;

        public SlaughterService(IslaughterRepository repository)
        {
            this.repository = repository;
        }

        public async Task<slaughterInfo> GetSlaughter(int id)
        {
            var list = (await repository.GetAllAsync()).FirstOrDefault(x => x.GoodsInfoid == id);
            return list;
        }

        public async Task<int> SlaughterAdd(slaughterInfo a)
        {
            return await repository.Update(a);
        }
    }
}
